<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/template.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>NHẬN NHÂN VIÊN</title>
<link rel="stylesheet" href="../css/reset.css" type="text/css" media="all" />
<link rel="stylesheet" href="../css/layout.css" type="text/css" media="all" />
<link rel="stylesheet" href="../css/style.css" type="text/css" media="all" />
<script type="text/javascript" src="../js/jquery-1.6.js" ></script>
<script type="text/javascript" src="../js/cufon-yui.js"></script>
<script type="text/javascript" src="../js/cufon-replace.js"></script>  
<script type="text/javascript" src="../js/Forum_400.font.js"></script>
<script type="text/javascript" src="../js/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="../js/tms-0.3.js"></script>
<script type="text/javascript" src="../js/tms_presets.js"></script>
<script type="text/javascript" src="../js/script.js"></script>
<script type="text/javascript" src="../js/atooltip.jquery.js"></script> 

<script language="javascript" type="text/javascript">
	function Highlight_Box_On(current)
	{	
		document.getElementById(current).style.backgroundColor = "#00EEFF";
	}
	
	function Highlight_Box_Off(current)
	{
		document.getElementById(current).style.backgroundColor = "white";
	}
</script>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
</head>

<body id="page1">
<center>
	<?php
		@ $con = mysql_pconnect('localhost', 'root', '');
											
		@ $nameCookie = $_COOKIE['cafe'];
							
		@ $cmnd = $_POST['cmnd'];
		@ $matkhau = $_POST['matkhau'];
		@ $matkhau = hash("sha512", $matkhau);
										
		if (!$con)
		{
			die('Could not connect: ' . mysql_error());
		}
										
		@ mysql_set_charset('utf8');
		@ mysql_select_db('cafe');
							
		$query = "SELECT * FROM `cookie` c WHERE c.cookie = '".$nameCookie."'";
		$result = mysql_query($query) or die('Error, query failed');
		$row = mysql_fetch_array($result);
		$log = stripslashes($row['log']);
							
		if( $log == 1 )
		{	
			if (isset($_COOKIE["cafe"]))
			{						
				$query = "SELECT * FROM `taikhoan` t INNER JOIN `cookie` c ON t.cmnd = c.cmnd WHERE c.cookie = '".$nameCookie."'";
				$result = mysql_query($query) or die('Error, query failed');
												
				if( mysql_num_rows($result) != 0 )
				{
					$row = mysql_fetch_array($result);
											
					$cmnd = stripslashes($row['cmnd']);
					echo "Chào ".$cmnd;
											
					if( stripslashes($row['loai']) == 1 )
					{
						$link = "../menu/chuquan.php";
					}
					else if ( stripslashes($row['loai']) == 2 )
					{
						$link = "../menu/quanly.php";
					}
					else if ( stripslashes($row['loai']) == 3 )
					{
						$link = "../menu/phucvu.php";
					}
					else if ( stripslashes($row['loai']) == 4 )
					{
						$link = "../menu/nhabep.php";
					}
					echo "&nbsp&nbsp&nbsp<a href='$link'>"."Trang tài khoản"."</a>";
					echo "&nbsp&nbsp&nbsp<a href='../login/doimatkhau.php'>"."Đổi mật khẩu"."</a>";
					echo "&nbsp&nbsp&nbsp<a href='../login/deletecookie.php'>"."Đăng xuất"."</a>";
				}
				else
				{
					echo "<a href='../login/dangnhap.php'>"."Đăng nhập"."</a>";
				}
			}
			else
			{
				echo "<a href='../login/dangnhap.php'>"."Đăng nhập"."</a>";
			}
		}
		else
		{
			echo "<a href='../login/dangnhap.php'>"."Đăng nhập"."</a>";
    	}
    ?>
    <div class="body6">
        <div class="body1">
            <div class="body5">
                <div class="main">
                    <header>
                    	<h1><a href="../home.php" id="logo">5PM Cafe</a></h1>
                    	<nav>
                    		<ul id="top_nav">
                    			<li><a href="../home.php"><img src="../images/icon_1.gif" alt=""></a></li>
                    			<li><a href="#"><img src="../images/icon_2.gif" alt=""></a></li>
                    			<li class="end"><a href="Contacts.php"><img src="../images/icon_3.gif" alt=""></a></li>
                    		</ul>
                    	</nav>
                    	<nav>
                    		<ul id="menu">
                    			<li><a href="../home.php">Nhà Hàng</a></li>
                    			<li><a href="../Cuisine.php">Am Thuc</a></li>
                    			<li><a href="../Wine.php">Ruou</a></li>
                    			<li><a href="../CookBook.php">Hoc Nau An</a></li>
                    			<li><a href="../Contacts.php">Gop Y</a></li>
                    		</ul>
                    	</nav>
                    </header><div class="ic">More Website Templates  @ TemplateMonster.com - August 1st 2011!</div>
                </div>
            </div>
        </div>
    </div>
<!-- InstanceBeginEditable name="body content" -->
<?php
	if (isset($_COOKIE["cafe"]))
	{
		@ $con = mysql_pconnect('localhost', 'root', '');
											
		@ $nameCookie = $_COOKIE['cafe'];
										
		if (!$con)
		{
			die('Could not connect: ' . mysql_error());
		}
										
		@ mysql_set_charset('utf8');
		@ mysql_select_db('cafe');
				
		$query = "SELECT * FROM `taikhoan` t INNER JOIN `cookie` c ON t.cmnd = c.cmnd  INNER JOIN `nhanvien` n ON t.cmnd = n.cmnd WHERE c.cookie = '".$nameCookie."'";
						
		$result = mysql_query($query) or die('Error, query failed');
						
		if ( mysql_num_rows($result) == 0 )
		{
			header('location: ../login/deletecookie.php');
			exit;
		}
		else
		{
			$row = mysql_fetch_array($result);
			$loai = stripslashes($row['loai']);
							
			if( $loai == 1 || $loai == 2 )
			{
				echo "<div align='center'><h1>".stripslashes($row['hoten']."</h1></div>");
			}
			else
			{
				header('location: ../login/deletecookie.php');
				exit;
			}
		}
	}
	else
	{
		header('location: ../login/deletecookie.php');
		exit;
	}
?>
<form name="regform" action="../execute/xuly_nhannhanvien.php" method="POST">
	<table width="100%">
		<tr>
			<td align="right" width="40%">
             	<b>CMND:</b>
            </td>
            <td width="2%">
            </td>
            <td align="left" width="58%">
            	<input type="text" name="cmnd" id="cmnd" title="Nhập cmnd" style="width:25%;" maxlength="9" onfocus="Highlight_Box_On('cmnd')" onblur="Highlight_Box_Off('cmnd')" /> *
            </td>
		</tr>
    	<tr>
			<td align="right" width="40%">
            	<b>Họ tên:</b>
            </td>
            <td width="2%">
            </td>
            <td align="left" width="58%">
            	<input type="text" name="hoten" id="hoten" title-"Nhập họ tên" onfocus="Highlight_Box_On('hoten')" onblur="Highlight_Box_Off('hoten')" maxlength="100" style="width:50%"/> *
            </td>
      	</tr>
        <tr>
			<td align="right" width="40%">
            	<b>Giới tính:</b>
            </td>
            <td width="2%">
            </td>
            <td align="left" width="58%">
                <input title="Nam" name="gioitinh" checked="checked" id="gioitinh" type="radio" value="Nam" />Nam
                <input title="Nữ" name="gioitinh" id="gioitinh" type="radio" value="Nữ"  />Nữ
            </td>
        </tr>
        <tr>
			<td align="right" width="40%">
            	<b>Ngày sinh:</b>
            </td>
            <td width="2%">
            </td>
            <td align="left" width="58%">
            	<input class="reg_multi" type="text" name="ngaysinh" id="ngaysinh" maxlength="2" title="Nhập ngày sinh nhận viên" onfocus="Highlight_Box_On('ngaysinh')" onblur="Highlight_Box_Off('ngaysinh')" /> 
                /
                <input class="reg_multi" type="text" name="thangsinh" id="thangsinh" maxlength="2" title="Nhập tháng sinh nhận viên" onfocus="Highlight_Box_On('thangsinh')" onblur="Highlight_Box_Off('thangsinh')" /> 
                /
               	<input class="reg_multi" type="text" name="namsinh" id="namsinh" maxlength="4" title="Nhập năm sinh nhận viên" onfocus="Highlight_Box_On('namsinh')" onblur="Highlight_Box_Off('namsinh')" /> *
          	</td>
		</tr>
        <tr>
			<td align="right" width="40%">
            	<b>Vị trí:</b>
            </td>
            <td width="2%">
            </td>
            <td align="left" width="58%">
            	<select name="vitri" id="vitri" onfocus="Highlight_Box_On('vitri')" onblur="Highlight_Box_Off('vitri')">
                	<option value="3">Phục vụ</option>
                    <option value="4">Nhà bếp</option>
                </select> *
           	</td>
		</tr>
        <tr>
			<td align="right" width="40%">
            	<b>Điện thoại:</b>
            </td>
            <td width="2%">
            </td>
            <td align="left" width="58%">
            	<input type="text" name="dienthoai" id="dienthoai" onfocus="Highlight_Box_On('dienthoai')" onblur="Highlight_Box_Off('dienthoai')" maxlength="20" style="width:50%"/> *
            </td>
		</tr>
        <tr>
			<td align="right" width="40%">
            	<b>Địa chỉ:</b>
            </td>
            <td width="2%">
            </td>
            <td align="left" width="58%">
            	<input type="text" name="diachi" id="diachi" onfocus="Highlight_Box_On('diachi')" onblur="Highlight_Box_Off('diachi')" maxlength="100" style="width:50%"/> *
            </td>
		</tr>
        <tr>
			<td align="right" width="40%">
            	<b>Email:</b>
            </td>
            <td width="2%">
            </td>
            <td align="left" width="58%">
            	<input type="text" name="email" id="email" title-"Nhập họ tên" onfocus="Highlight_Box_On('email')" onblur="Highlight_Box_Off('email'); isValidemail(this); " maxlength="100" style="width:50%"/> *
            </td>
      	</tr>
        <tr>
			<td align="right" width="40%">
            	<b>Ngày bắt đầu làm việc:</b>
            </td>
            <td width="2%">
            </td>
            <td align="left" width="58%">
            	<input class="reg_multi" type="text" name="ngaybatdau" id="ngaybatdau" maxlength="2" title="Nhập ngày bắt đầu làm việc của nhân viên" onfocus="Highlight_Box_On('ngaybatdau')" onblur="Highlight_Box_Off('ngaybatdau')" /> 
                /
                <input class="reg_multi" type="text" name="thangbatdau" id="thangbatdau" maxlength="2" title="Nhập ngày bắt đầu làm việc của nhân viên" onfocus="Highlight_Box_On('thangbatdau')" onblur="Highlight_Box_Off('thangbatdau')" /> 
                /
               	<input class="reg_multi" type="text" name="nambatdau" id="nambatdau" maxlength="4" title="Nhập ngày bắt đầu làm việc của nhân viên" onfocus="Highlight_Box_On('nambatdau')" onblur="Highlight_Box_Off('nambatdau')" /> *
          	</td>
		</tr>
        <tr>
			<td align="right" width="40%">
            	<b>Dụng cụ:</b>
            </td>
            <td width="2%">
            </td>
            <td align="left" width="58%">
            	<input type="text" name="dungcu" id="dungcu" onfocus="Highlight_Box_On('dungcu')" onblur="Highlight_Box_Off('dungcu')" maxlength="100" style="width:50%"/>
            </td>
		</tr>
        <tr align="center">
        	<td colspan="3"><input type="submit" value="Nhận nhân viên" style="background-color:#CCCCCC" /></td>
        </tr>
	</table>
</form>
<!-- InstanceEndEditable -->
<div class="body3">
	<div class="body4">
		<div class="main">
<!-- footer -->
			<footer>
				<div class="wrapper">
					<section class="col1 pad_left1">
						<span style="font-size:27px;color:#230000;line-height:1.2em;padding:20px 0 9px 0;letter-spacing:-1px">Liên Hệ Miễn Phí: </br>(+84) 12 0303 6166</span></br>
						<a rel="nofollow" href="../home.php" target="_blank">Bản quyền thuộc về</a> 5PM Team
					</section>
					<section class="col2 pad_left1">
						<h3>Theo Dõi 5PM Cafe </h3>
						<ul id="icons">
							<li><a href="#" class="normaltip" title="Facebook"><img src="../images/icon1.gif" alt=""></a></li>
							<li><a href="#" class="normaltip" title="Linkedin"><img src="../images/icon2.gif" alt=""></a></li>
							<li><a href="#" class="normaltip" title="Twitter"><img src="../images/icon3.gif" alt=""></a></li>
							<li><a href="#" class="normaltip" title="Delicious"><img src="../images/icon4.gif" alt=""></a></li>
							<li><a href="#" class="normaltip" title="Technorati"><img src="../images/icon5.gif" alt=""></a></li>
						</ul>
					</section>
				</div>
				<!-- {%FOOTER_LINK} -->
			</footer>
<!-- / footer -->
		</div>
	</div>
</div>
<script type="text/javascript"> Cufon.now(); </script>
</center>
</body>
<!-- InstanceEnd --></html>